﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>输出同学姓名</title>
</head>
<body>
    <script>
        function MyClass(x) {
            this.x = x;
        }
        let proObj = new MyClass('x');
        InheritClass.prototype = proObj;
        MyClass.prototype.protox = 'xxx';
        function InheritClass(y) {
            this.y = y;
        }
        let obj = new InheritClass('Hello class');
        proObj.protox = '班级名单';
        MyClass.prototype.protox = '刘亦婷';
        proObj.x = '汪一涵';
        alert(obj.protox);
        alert(obj.x);
    </script>
</body>
</html>
